#include "include.h"

#define GPIO_OUTPUT_PIN_SEL  ((1ULL<<LED_0) | (1ULL<<LED_1) | (1ULL<<LED_2) | (1ULL<<LED_3) | (1ULL<<LED_4))

#define LED_0                  32
#define LED_1                  33
#define LED_2                  27
#define LED_3                  14
#define LED_4                  12

/*

    函数功能：gpio初始化
    函数名称：lonon_gpio_init

*/
void lonon_gpio_init()
{
    gpio_config_t io_conf;
    //disable interrupt
    io_conf.intr_type = GPIO_PIN_INTR_DISABLE;
    //set as output mode
    io_conf.mode = GPIO_MODE_OUTPUT;
    //bit mask of the pins that you want to set,e.g.GPIO18/19
    io_conf.pin_bit_mask = GPIO_OUTPUT_PIN_SEL;
    //disable pull-down mode
    io_conf.pull_down_en = 0;
    //disable pull-up mode
    io_conf.pull_up_en = 0;
    //configure GPIO with the given settings
    gpio_config(&io_conf);

    gpio_set_level(LED_0,1);
    gpio_set_level(LED_1,1);
    gpio_set_level(LED_2,1);
    gpio_set_level(LED_3,1);
    gpio_set_level(LED_4,1);
}

/*

    函数功能：led驱动
    函数名称：lonon_led_drive
    输入：led_num           引脚
    输入：sw                开关
*/
void lonon_led_drive(unsigned char led_num,unsigned char sw)
[
    gpio_set_level(led_num,sw);
]